package cn.hou.optional;

import java.util.Optional;

//Optional不能被序列化
public class Man {
	////默认空实例,避免null引起空指针
	private Optional<Goddess> goddess=Optional.empty();

	public Optional<Goddess> getGoddess() {
		return goddess;
	}

	public void setGoddess(Optional<Goddess> goddess) {
		this.goddess = goddess;
	}
	@Override
	public String toString() {
		return "Man [goddess=" + goddess + "]";
	}
	public Man() {
	}
}
